package com.example.thinvent.springlife;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author xhf
 */
public class BeanLifeCycle {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        Person person = context.getBean("person", Person.class);
        System.out.println(person);

        System.out.println("关闭容器");
        context.registerShutdownHook();

    }
}
